package com.onesports.intelligent.k12.polarlight.service.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.onesports.intelligent.k12.polarlight.domain.entity.sys.RoleMenu;
import com.onesports.intelligent.k12.polarlight.mapper.sys.RoleMenuMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 角色权限Service
 *
 * @author Wsy
 **/
@Service
@RequiredArgsConstructor
public class RoleAuthService {

    private final RoleMenuMapper roleAuthMapper;





    /**
     * 添加角色权限
     *
     * @param roleAuth 入参
     */
    public void add(RoleMenu roleAuth) {
        this.roleAuthMapper.insert(roleAuth);
    }

    /**
     * 删除角色权限
     * @param roleId
     */
    public void deleteByRoleId(String roleId) {
        this.roleAuthMapper.delete(new QueryWrapper<RoleMenu>().lambda().eq(RoleMenu::getRoleId,roleId));
    }
}
